<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
      <el-breadcrumb-item>管理员列表</el-breadcrumb-item>
    </el-breadcrumb>

    <el-card>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="username" label="用户名" width="180" />
        <el-table-column prop="account" label="账号" width="180" />
        <el-table-column prop="addtime" label="注册时间" >
          <template #default="props">{{ formatDate(props.row.addtime) }}</template>
        </el-table-column>
        <el-table-column prop="uptime" label="更新时间" >
          <template #default="props">{{ formatDate(props.row.uptime) }}</template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { formatDate } from '@/utils/date'
import axios from "@/utils/axios";
import {ElMessage} from "element-plus";
export default {
  name: "Users",
  data() {
    return {
      formatDate,
      tableData: [],
      formInline: {
        user: '',
        region: '',
      },
    }
  },
  created() {
    this.getList ()
  },
  methods: {
    async getList () {
      const { data: res } = await axios.get('admin', { params: this.queryinfo })
      if (res.code !== 1000) return ElMessage.error(res.msg)
      this.tableData = res.data
    },
  },
}
</script>

<style scoped>

</style>
